#include "student.hpp"

static bool validate_student_id(std::string id) {
    if (id.length() != 12) {
        return false;
    }

    return true;
}

std::istream &read_student(std::istream &is, Student &p) {
    is >> p.id_;
    if (!validate_student_id(p.id_)) {
        is.setstate(is.rdstate() | ~is.failbit);
    }

    read_person(is, p);


    return is;
}

std::ostream &print_student(std::ostream &os, Student &p) {
    os << p.id_ << " ";
    print_person(os, p);

    return os;
}
